1. Field of the Invention
The present invention relates to an apparatus and method for detecting motion vector suited for use in high-efficiency coding of video data.
2. Description of the Related Art
For motion prediction in TM5 (test mode 5) of the international standard ITU-T H.262/MPEG2 for video data compression, the motion is fully examined on the basis of half of pixel. However, this system requires the handling of a large amount of data. Therefore, a motion estimating process is divided into two steps: a step of calculating a motion vector in two-pixel precision using a first stage motion estimator and a step of calculating a motion vector in half-pixel precision from the motion vectors calculated at the first stage, using a second stage motion estimator.
FIG. 1 shows the structure of a conventional motion detecting apparatus. Referring to FIG. 1, a filter (FL) 501 receives and converts a video source signal into signals refi1 and serc1 having an input format adaptive for a motion estimator (ME) 503. A memory (MEM) 502 is connected to the filter 501 and stores the reference signal refi1 for I picture data and P picture data. The motion estimator 503 is connected to the filter 501 and the memory 502 and generates and outputs an address signal AD1 shifted by a movement quantity corresponding to the motion vector MV2xe2x80x2 to the memory 502. The motion estimator 503 calculates an absolute value of a difference between the reference signal ref1 shifted by the movement quantity corresponding to the motion vector MV2xe2x80x2 from the start coordinates of normal retrieval and the video source signal src1 received from the filter 501, and accumulates the absolute values over 256 samples in units of macroblocks. The motion estimator 503 searches a motion vector (MV) when an absolute error (AE) is minimum, and adds the motion vector MV2xe2x80x2 to the searched motion vector. An addition result is then outputted from the motion estimator 503 as the motion vector MV1.
An memory 505 and an motion estimator 506 are connected to a delay (DLY) unit 504 and receive a video source signal delayed by the delay unit 504. The memory 505 and the motion estimator 506 are the same in the structure as the units 502 and 503. Similarly, the motion vector MV at a minimum of the absolute error (AE) is added with the motion vector MV1 so that the addition result is outputted as a motion vector MV2.
A memory (MEM) 507 is connected to the motion estimator 506 and stores the motion vector MV2 outputted from the motion estimator 506. The stored motion vector MV2 is then outputted as the motion vector MV2xe2x80x2. Accordingly, the video signal will hardly be degraded in quality while the amount of data to be calculated is significantly reduced.
However, in the conventional motion detecting apparatus, there is a possibility that a value of an erroneously detected motion vector is large when a video data changing largely and randomly over the search region of the first stage motion estimator is coded. As the coding of the large motion vector value requires a large amount of data, the ratio of coded data of the motion vector to the entire coded data will increase, resulting in degradation of the quality of the image.
In conjunction with a high efficiency vide data coding system is disclosed in Japanese Laid Open Patent Application (JP-A-Heisei 6-62392). In this reference, the high efficiency vide data coding system is composed of a 2-dimensional space filter (10), a subtracter (1) and a conversion section. The 2-dimensional space filter (10) controls the spatial resolution of an input video signal (a) in accordance with to the movement quantity (n) to output a video signal (b). The subtracter (1) outputs an interframe difference signal (c) of the video signal (b) and a video signal (m) which is obtained through a motion compensation. Also, the conversion section is composed of a quantizing unit (3), an orthogonal transformation unit (2), a motion detector (9) and a variable memory (8). The conversion section receives the interframe difference signal (c) and outputs a quantized signal (e). The motion detector (9) receives the input video signal (a) and a signal (t) obtained by carrying out inverse quantization transformation to the quantized signal (e) to output the movement quantity (n) to the 2-dimensional filter (10). The variable memory (8) sends out the video signal (m) to the subtracter (1). Thus, the spatial filter is provided in the front of the coding state.
Also, a moving object detecting apparatus is disclosed in Japanese Laid Open Patent Application (JP-A-Heisei 8-55222). In this reference, a first frame memory (103a) stores a one frame of an input signal (1a). A first movement detecting circuit 104a detects the moving object from the input signal (1a) and an output signal (1c) of the first frame memory (103). A switch (108) selects one image from two images based on a control signal (1i) indicative of a final movement object detection result. A second frame memory stores (1l) stores a signal outputted the switch (108). A second movement detecting circuit (104b) detects the moving object from the input signals (1a) and the output signal (1d) outputted from second frame memory (103b). A logical operation circuit (105) carries out a logical operation of the output signal (1e) from the first movement detecting circuit (104a) and the output signal (1f) from the second movement detecting circuit (104b). A connection processing circuit (106) combines moving object areas to the output signal outputted from the logical operation circuit (105).
Also, an image coding apparatus is disclosed in Japanese Laid Open Patent Application (JP-A-Heisei 8-102951). In this reference, an image information evaluation circuit (50) evaluates an amount of information of a plurality of frames of input image data stored in a frame memory (40). A scene change detecting circuit (31) detects a scene change. A DCT circuit (14) carries out a DCT process of the image data. A quantizing unit (15) quantizes DCT coefficients. A compressing method selecting circuit (32) selects a method of compressing based on the evaluation value and the scene changing detection output adaptively. A quantization step controller (39) predicts a basic quantization step of the quantizing unit (15) from the evaluation value and an expected amount of data obtained through the compression of one frame of the image data by the selected compressing method.
Also, a motion compensation apparatus is disclosed in Japanese Laid Open Patent Application (JP-A-Heisei 11-243551). In this reference, a motion compensation processing section (200) outputs a motion vector between an input image and a reference image and an estimated image obtained from the reference image in accordance with the motion vector. An absolute value difference summing section (205) as a distortion quantity operation section inputs the input image and the estimated image and determines a distortion quantity between the input image and the estimated image. A vector value coding section (207) inputs and codes the motion vector and outputs a vector code quantity. An optimal vector determining section (210) inputs the motion vectors, the distortion quantities and the vector code quantities, determines evaluation functions calculated from the vector code quantities and the distortion quantities to all of the motion vectors, and outputs the motion vector with a minimum value as an optimal vector.
Also, a motion detecting method is disclosed in Japanese Patent No. 2,869,142. In this reference, a temporary vector with a high similarity to a true vector is detected through block matching from sample vectors arranged in a low density spatially in a first step. A next temporary vector nearer the true vector is detected in a second step through block matching from sample vectors arranged the around the temporary vector in a higher density than the first step. The true vector is detected by repeating the above step N times. In this case, a filter limits a spatial frequency band of input image data as the spatial density of the sample vectors is lower. A sub-sampling section decreases the number of sub-samples as the spatial density of the sample vectors is lower. Memories are provides for the steps other than the Nth step to store the input image data subjected to the sub-sampling for the block matching. Memories are provided for the steps to store said input image data for the block matching. Thus, the operation of the limitation of the frequency band by the filter, the operation of the sub-sampling by the sub-sampling sections, the read operation and the write operation of the image data are carried out in parallel for every step.
Therefore, an object of the present invention is to provide a motion detecting apparatus which can reduce the value of motion vector erroneously detected to an optimum or minimum quantity.
Another object of the present invention is to provide a motion detecting apparatus which can reduce the coded data for other information to suppress the degradation of image quality.
In order to achieve an aspect of the present invention, a motion detecting apparatus includes a comparator and motion estimator. The comparator compares a threshold and an input absolute error, and selects as a selected motion vector, one of a predetermined motion vector and an input motion vector based on the comparison result. The motion estimator determines a reference video signal based on the selected motion vector, and determines an absolute error from the determined reference video signal and an input video signal to output the determined absolute error. Then, the motion estimator estimates a motion vector from the determined reference video signal and the input video signal such that the absolute error is minimum, to output a motion vector determined based on the estimated motion vector and the selected motion vector.
The comparator may select the input motion vector as the selected motion vector, when the input absolute error is not greater than the threshold.
Also, the comparator may include a comparing unit which compares the threshold and the input absolute error, and a selector which selects as the selected motion vector, one of the predetermined motion vector and the input motion vector based on the comparison result.
Also, the motion detecting apparatus may further include a delay unit which delays a video signal to produce the input vide signal.
Also, when a motion detecting unit includes the comparator and the motion estimator, the motion detecting apparatus may include n (n is a natural number more than 1) of the motion detecting units connected in series. In this case, each of the n motion detecting units receives the determined absolute error and the determined motion vector from a previous stage as the input absolute error and the input motion vector, and a first stage of the n motion detecting units receives the determined absolute error and the determined motion vector from a last stage as the input absolute error and the input motion vector.
In another aspect of the present invention, a method of detecting a motion vector, is attained by (a) comparing a threshold and an input absolute error; by (b) selecting as a selected motion vector, one of a predetermined motion vector and an input motion vector based on the comparison result; by (c) determining a reference video signal based on the selected motion vector; by (d) determining an absolute error from the determined reference video signal and an input video signal to output the determined absolute error; and by (e) estimating a motion vector from the determined reference video signal and the input video signal such that the absolute error is minimum, to output a motion vector determined based on the estimated motion vector and the selected motion vector.
Also, the (b) selection may includes: selecting the input motion vector as the selected motion vector, when the input absolute error is not greater than the threshold.
Also, the method may further include delaying a video signal to produce the input vide signal.
Also, when the method includes a sequence of process groups, each of the process groups includes the (a) to (e) steps.
In order to achieve still another aspect of the present invention, a motion detecting apparatus includes a comparator and a motion estimator. The comparator selects as a selected motion vector, one of a predetermined motion vector and an input motion vector using first and second thresholds, an input absolute error and the input motion vector. The motion estimator determines a reference video signal based on the selected motion vector, and determines an absolute error from the determined reference video signal and an input video signal to output the determined absolute error. Then, the motion estimator estimates a motion vector from the determined reference video signal and the input video signal such that the absolute error is minimum, to output a motion vector determined based on the estimated motion vector and the selected motion vector.
Here, the comparator may select the input motion vector as the selected motion vector, when the input absolute error is not greater than the first threshold, and when the input motion vector is not greater than the second threshold.
Also, the comparator may include a first comparing unit which compares the first threshold and the input absolute error, a second comparing unit which compares the second threshold and the input motion vector, a logic circuit which carries logic calculation of the comparing result of the first comparing unit and the comparing result of the second comparing unit, and a selector which selects as the selected motion vector, one of the predetermined motion vector and the input motion vector based on the logic calculation result.
Also, the motion detecting apparatus may further include a delay unit which delays a video signal to produce the input vide signal.
Also, when a motion detecting unit includes the comparator and the motion estimator, the motion detecting apparatus may include n (n is a natural number more than 1) of the motion detecting units connected in series. In this case, each of the n motion detecting units receives the determined absolute error and the determined motion vector from a previous stage as the input absolute error and the input motion vector, and a first stage of the n motion detecting units receives the determined absolute error and the determined motion vector from a last stage as the input absolute error and the input motion vector.
In yet still another aspect of the present invention, a method of detecting a motion vector is attained by (a) selecting as a selected motion vector, one of a predetermined motion vector and an input motion vector using first and second thresholds, an input absolute error and the input motion vector; by (b) determining a reference video signal based on the selected motion vector; by (c) determining an absolute error from the determined reference video signal and an input video signal to output the determined absolute error; and by (c) estimating a motion vector from the determined reference video signal and the input video signal such that the absolute error is minimum, to output a motion vector determined based on the estimated motion vector and the selected motion vector.
Also, the (a) selection may be attained by selecting the input motion vector as the selected motion vector, when the input absolute error is not greater than the first threshold, and when the input motion vector is not greater than the second threshold.
Also, the (a) selection may be attained by carrying out a first comparison of the first threshold and the input absolute error; by carrying out a second comparison of the second threshold and the input motion vector; by carrying logic calculation of the first comparison result and the second comparison result; and by selecting as the selected motion vector, one of the predetermined motion vector and the input motion vector based on the logic calculation result.
Also, the method may further include delaying a video signal to produce the input vide signal.
Also, when the method comprises a sequence of process groups, each of the process groups includes said (a) to (d) steps.